﻿using System;
using System.Linq;
using Orchard;
using Orchard.Events;
using Orchard.Localization;
using Orchard.Logging;
using Orchard.UI.Notify;
using Hazdesign.TwitterRules.Models;
using Hazdesign.TwitterRules.Services;

namespace Hazdesign.TwitterRules.Rules{
    public class TwitterActions : PublishingActions, IActionProvider{
        public TwitterActions(
            ITwitterService publishingService,
            IOrchardServices orchardServices) : base(publishingService, orchardServices){
        }

        public void Describe(dynamic describe){
            Func<dynamic, LocalizedString> display = context => T("Send a tweet");

            describe.For("Twitter", T("Twitter"), T("Twitter"))
                .Element("SendTweet", T("Send tweet"), T("Sends a tweet, updating the current user's Twitter profile."), (Func<dynamic, bool>)Publish, display, "ActionTweet");
        }
    }
}